<?php
class Application_Form_News_Comment_Captcha extends Zend_Form
{
	public function init()
	{
		$this->getDecorator('HtmlTag');
		$this->setOptions(array('class' => 'form'));
		$this->setAction('/news/comment.add.accept')
			->setMethod('post')
			->setAttribs(array(
				'id' => 'comment-add-accept-captcha-form',
				'class' => 'form'
			));
		$captcha = new Zend_Form_Element_Captcha('captcha', array(
			'captcha' => array(
				'captcha'   => 'Image', // Тип CAPTCHA
				'wordLen'   => 6,
				'width'     => 260,
				'timeout'   => 120,
				'expiration'=> 300,
				'font'      => ROOT_DIR . DS . 'Misc' . DS . 'Captcha' . DS . 'Font' . DS. 'TAHOMA.TTF',
				'imgDir'    => ROOT_DIR . DS . 'images' . DS . 'captcha' . DS,
				'imgUrl'    => '/images/captcha/',
				'gcFreq'    => 5
			),
		));
		
		$this->addElement($captcha);
	}
}